package com.manxi.controller.user;


import com.manxi.dto.TrendsPageQueryDTO;
import com.manxi.result.PageResult;
import com.manxi.result.Result;
import com.manxi.service.TrendsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("userTrendsController")
@RequestMapping("/user/trends")
@Api(tags = "用户端商家动态相关接口")
@Slf4j
public class TrendsController {
    @Autowired
    private TrendsService trendsService;

    /**
     * 动态分页查询
     *
     * @param trendsPageQueryDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("动态分页查询")
    public Result<PageResult> page(TrendsPageQueryDTO trendsPageQueryDTO) {
        log.info("动态分页查询:{}", trendsPageQueryDTO);
        PageResult pageResult = trendsService.pageQuery(trendsPageQueryDTO);
        return Result.success(pageResult);
    }

}
